package com.tanhua.server.controller;

import com.tanhua.server.service.TaoHuaSoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class TaoHuaSoundController {

    @Autowired
    private TaoHuaSoundService taoHuaSoundService;

    @PostMapping("/peachblossom")
    public ResponseEntity<Object> sendVoice(@RequestBody MultipartFile soundFile) throws IOException {
        return taoHuaSoundService.sendVoice(soundFile);
    }

    @GetMapping("/peachblossom")
    public ResponseEntity<Object> acceptVoice() {
        return taoHuaSoundService.acceptVoice();
    }
}
